#pragma once

namespace xtd {

template <class T, class I> struct dereferencing_iterator {

	I	_val;

	typedef T value_type;

	dereferencing_iterator()
		: _val() { }
	dereferencing_iterator(I val)
		: _val(val) { }
	dereferencing_iterator(const dereferencing_iterator<T, I> & rhs)
		: _val(rhs._val) { }
	bool operator == (const dereferencing_iterator<T, I> & rhs) const
		{ return _val == rhs._val; }
	bool operator != (const dereferencing_iterator<T, I> & rhs) const
		{ return _val != rhs._val; }
	dereferencing_iterator<T, I> & operator ++() {
		++_val;
		return * this;
	}
	dereferencing_iterator<T, I> & operator --() {
		--_val;
		return * this;
	}
	T & operator * () 
		{	return * (* _val);	}
};

} // xtd
